/*
 *@Description: 用户相关接口
 *@Author:  lupan
 *@Date: 2019-08-04 21:15:05
*/
const Router = require('koa-router')
const router = new Router({
  prefix: '/user'
})

router.get('/info', async(ctx) => {
  const token = ctx.query.token
  if (!token) {
    ctx.body = $msgError('参数不全')
    return
  }
  const dbData = await $dbQuery.findData([{
    label: 'open_id',
    value: $dbQuery.string(token)
  }], 'user')
  ctx.body = $msgSuccess(dbData[0])
})

module.exports = router